<?php

use p5\objects\FileUtils;

function copy_file($srcFile, $distFile)
{
    return FileUtils::copy_file($srcFile, $distFile);
}

function replace_file_content($filename, $matrix)
{
    return FileUtils::replace_file_content($filename, $matrix);

}

function get_file_content($filename)
{
    return FileUtils::get_file_content($filename);
}

function write_csv($matrix, $file, $title = array(), $info = "", $sum = "", $label = "", $encode = "gbk", $writeBOM = true)
{
    return FileUtils::write_csv($matrix, $file, $title, $info, $sum, $label, $encode, $writeBOM);
}


function download_file($filename)
{
    FileUtils::download_file($filename);
}

function send_file($file, $name)
{
    FileUtils::send_file($file, $name);
}

function check_file_newest($targetFile, $compareFile)
{
    return FileUtils::check_file_newest($targetFile, $compareFile);
}


function rewrite_file($targetFile, $content, $encode = "gb18030", $writeBom = true)
{
    FileUtils::rewrite_file($targetFile, $content , $encode, $writeBom);
}

function get_real_folder($relativePath)
{
    return FileUtils::get_real_folder($relativePath);
}

function get_real_path($relativePath)
{
    return FileUtils::get_real_path($relativePath);
}

function get_file_type($name)
{
    return FileUtils::get_file_type($name);
}

function list_folder($folder)
{
    return FileUtils::list_folder($folder);
}

function find_folders($folder)
{
    return FileUtils::find_folders($folder);
}

function find_files($folder, $types = array(), $include_sub_folder = true)
{
    return FileUtils::find_files($folder, $types, $include_sub_folder);
}

function create_folder($path, $Permission = 0755)
{
    return FileUtils::create_folder($path, $Permission);
}

function delete_dir($dir)
{
    return FileUtils::delete_dir($dir);
}

function lsr($dir)
{
    return FileUtils::lsr($dir);
}

function get_file($url, $folder = "./")
{
    return FileUtils::get_file($url, $folder);
}

function mkdirs($path, $mode = "0755")
{
    return FileUtils::mkdirs($path, $mode);
}

function get_file_path($file)
{
    return FileUtils::get_file_path($file);
}

function get_base_name($file)
{
    return FileUtils::get_base_name($file);
}

function unzip_with_encoding($zipFile, $sourceEncoding = "GBK", $unsafeFileTypes = array())
{
    return FileUtils::unzip_with_encoding($zipFile, $sourceEncoding, $unsafeFileTypes);
}

function one_file_of_unzip($zipFile, $sourceEncoding = "GBK", $unsafeFileTypes = array())
{
    return FileUtils::one_file_of_unzip($zipFile, $sourceEncoding, $unsafeFileTypes);
}

function get_dir_size($dir)
{
    return FileUtils::get_dir_size($dir);
}

function to_linux_path($path)
{
    return FileUtils::to_linux_path($path);
}